/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Behavioral.Interpreter;

import java.util.ArrayList;
import java.util.Iterator;

/**
 *
 * @author Demoni
 */
public class Test {

    public static void main(String[] args) {
       String romano = "LXI";
       Context context = new Context(romano);
       //Se construye el arbol
       ArrayList<Expression> arbol = new ArrayList<Expression>();
       arbol.add(new ThousandExpression());
       arbol.add(new HundredExpression());
       arbol.add(new TenExpression());
       arbol.add(new OneExpression());   
       //se Implementa
       Iterator<Expression> it = arbol.iterator();
       while (it.hasNext()){
           Expression exp = it.next();
           exp.interpret(context);
       }
       //se imprime
       System.out.print(context.output);
    }
}